import request from '@/utils/request'

// 查询申请维修审批列表
export function listRepair(query) {
  return request({
    url: '/app/repairManagement/repairApplyList',
    method: 'get',
    params: query
  })
}

// 查询申请维修审批详细
export function getRepair(approvalId) {
  return request({
    url: '/gwc/repair/' + approvalId,
    method: 'get'
  })
}

// 根据维修单id查询申请维修审批详情
export function getApprovalRepairId(repairId) {
  return request({
    url: '/gwc/repair/getApprovalRepairId',
    method: 'get',
    params: {
      repairId
    }
  })
}

// 新增申请维修审批
export function addRepair(data) {
  return request({
    url: '/gwc/repair',
    method: 'post',
    data: data
  })
}

// 修改申请维修审批
export function updateRepair(data) {
  return request({
    url: '/gwc/repair',
    method: 'put',
    data: data
  })
}

// 删除申请维修审批
export function delRepair(approvalId) {
  return request({
    url: '/gwc/repair/' + approvalId,
    method: 'delete'
  })
}
